import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '../views/Home.vue'
import homeChild from '../views/home/index'; // 引入首页的四个路由
import second from '../views/secondPage/index'; // 引入二级页面路由
// console.log(homeChild); // homeChild 是一个数组
const routes = [
  {
    path: '/',
    name: 'Home',
    redirect: '/index',
    component: Home,
    children:[ // 使用扩展运算符合并进来
      ...homeChild
    ]
  },
  ...second
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
